home *** CD-ROM | disk | FTP | other *** search
- ;MTYPE.ASM --
- ;Test for the presence of an active Color/Monochrome EGA/VGA.
-
- cr equ 13
-
- lf equ 10
-
- B_RAM segment at 40h
- org 87h
- info db ?
-
- B_RAM ends
-
- data segment public
- no_support db 'The required EGA or VGA is not active',cr,lf
- clr_ega db 'You have an active color EGA',cr,lf
- clr_vga db 'You have an active color VGA',cr,lf
- mono_ega db 'You have an active monochrome EGA',cr,lf
- mono_vga db 'You have an active monochrome VGA',cr,lf
-
- data ends
-
- code segment public
- assume CS:code
-
- main proc far
-
- start: push DS
- sub AX,AX
- push AX
-
- mov AX,data
- mov DS,AX
- assume DS:data
-
- mov AX,1a00h ;function 1a return display code
- int 10h ;AL will return as 1a if supported
-
- cmp AL,1ah
- jne no_dc
-
- cmp BL,7 ;Is it a monochrome VGA?
- je mono_v
-
- cmp BL,8 ;Is it a color VGA?
- je color_v
-
- mov BL,4 ;Is it a color EGA?
- je color_e
-
- mov BL,5 ;Is it a monochrome EGA?
- je mono_e
-
-
- no_dc:
- mov AH,12h ;Get information
- mov BL,10h ;about the EGA
- int 10h
- cmp BL,10h ;did it come back as 10h (no EGA)?
- je invalid ;yes, ship next test
-
- push DS
- mov AX,B_RAM ;BIOS RAM area
- mov DS,AX
- assume DS:B_RAM
- mov BL,info ;get information byte
-
- pop DS
- assume DS:DATA
-
-
- test BL,8 ;is the EGA active
- jz valid ;bit 3=0 means EGA active
-
- invalid:
- mov BX,offset no_support
- jmp finish
-
- valid:
- cmp BH,1 ;is monitor type monochrome?
- je mono_e
- jmp color_e
-
- mono_v:
- mov BX,offset mono_vga
- jmp finish
-
- color_v:
- mov BX,offset clr_vga
- jmp finish
-
- color_e:
- mov BX,offset clr_ega
- jmp finish
-
- mono_e:
- mov BX,offset mono_ega
- jmp finish
-
- finish:
- call print_msg
-
- ret
-
- main endp
-
- print_msg proc near
-
- next_char:
- mov dl,[bx] ;put it in dl
- mov ah,2 ;write to screen
- int 21h ;DOS call
- inc bx
- cmp dl,10 ;line feed?
- jne next_char ;no, get next character
-
- ret
-
- print_msg endp
- code ends
- end start
-